import "../index";
import config from "@/config/index.js";
import request from "../index.js";

//小狐狸签名登录
export const metamasklogin = (data) => {
  return request.post(`${config.baseUrl}/v1/user/metamasklogin`, {
    data: data,
  });
};

//获取登录随机串

export const getcode = (address) => {
  return request.post(`${config.baseUrl}/v1/user/getcode?${address}`);
};

// 获取签名随机数
export const getRandomNum = (data) => {
  return request.get(`${config.baseUrl}/webapi/getRandomNum`, {
    data: data,
  });
};

//
export const getblockvest = () => {
  return request.post(`${config.baseUrl}/v1/index/blockvest`);
};

export const invest = (data) => {
  return request.post(`${config.baseUrl}/v1/index/invest`, {
    data: data,
  });
};

export const getswapData = () => {
  return request.post(`${config.baseUrl}/v1/user/swapData`);
};
export const swap = (data) => {
  return request.post(`${config.baseUrl}/v1/user/swap`, {
    data: data,
  });
};

export const drawdData = () => {
  return request.post(`${config.baseUrl}/v1/user/drawdData`);
};
export const draw = (data) => {
  return request.post(`${config.baseUrl}/v1/user/draw`, {
    data: data,
  });
};

export const orderDetail = (data) => {
  return request.post(`${config.baseUrl}/v1/user/orderDetail`, {
    data: data,
  });
};
export const orders = () => {
  return request.post(`${config.baseUrl}/v1/user/orders`);
};

export const home = () => {
  return request.post(`${config.baseUrl}/v1/user/home`);
};

export const coinlog = (data) => {
  return request.post(`${config.baseUrl}/v1/user/coinlog`, {
    data: data,
  });
};

export const notice = () => {
  return request.post(`${config.baseUrl}/v1/index/notice`);
};

export const follow = () => {
  return request.post(`${config.baseUrl}/v1/index/follow`);
};
